package panda.query.tree;

import panda.query.scan.Scanner;
import panda.query.struct.Attribute;
import panda.record.Schema;

/**
 * @author Tian Yuan
 *
 */
public interface QueryTreeNode {

	/**
	 * Fetches the Scanner for the resulting table
	 * @return 
	 */
	public Scanner open();
	
	/**
	 * Estimates the number of blocks accessed
	 * @return
	 */
	public int blockAccessed();
	
	/**
	 * Estimates the size of the output
	 * @return
	 */
	public int outputSize();
	
	/**
	 * Estimates the number of distinct tuples in output
	 * @return
	 */
	public int distinctSize(Attribute attr);
	
	/**
	 * Gets the schema of the query
	 * @return the schema of the query
	 */
	public Schema getSchema();
	
}
